package com.zsrt.java.day20170102.lh.collegesorequerysystem;
/**
 * 用户信息【准考证号码 密码 姓名 年龄 所属省份 户籍所在地 联系方式 语文分数 数学分数 英语分数 角色（admin:管理员  user：普通用户）】
 * @author My
 *
 */
public class User  implements Comparable<User>{
	
	/**
	 * 准考证号码
	 */
	private  String cardNum;
	
	/**
	 * 密码
	 */
	private  String pass;
	
	/**
	 * 姓名
	 */
	private  String name;
	
	/**
	 * 年龄
	 */
	private  int age;
	
	/**
	 * 省份
	 */
	private String province;
	
	/**
	 * 户籍所在地
	 */
	private String city;
	
	/**
	 * 联系方式
	 */
	private String address;
	
	/**
	 * 语文
	 */
	private double chineseScore;
	
	/**
	 * 数学
	 */
	private double mathScore;
	
	/**
	 * 英语
	 */
	private double englishScore;
	
	/**
	 * 管理员  admin:管理员  user：普通用户
	 */
	private String role;
	
	private double total;
	
	public double getTotal() {
		return total;
	}
	public void setTotal(double total) {
		this.total = total;
	}
	public String getCardNum() {
		return cardNum;
	}
	public void setCardNum(String cardNum) {
		this.cardNum = cardNum;
	}
	public String getPass() {
		return pass;
	}
	public void setPass(String pass) {
		this.pass = pass;
	}
	public String getName() {
		return name;
	}
	public void setName(String name) {
		this.name = name;
	}
	public int getAge() {
		return age;
	}
	public void setAge(int age) {
		this.age = age;
	}
	public String getProvince() {
		return province;
	}
	public void setProvince(String province) {
		this.province = province;
	}
	public String getCity() {
		return city;
	}
	public void setCity(String city) {
		this.city = city;
	}
	public String getAddress() {
		return address;
	}
	public void setAddress(String address) {
		this.address = address;
	}
	public double getChineseScore() {
		return chineseScore;
	}
	public void setChineseScore(double chineseScore) {
		this.chineseScore = chineseScore;
	}
	public double getMathScore() {
		return mathScore;
	}
	public void setMathScore(double mathScore) {
		this.mathScore = mathScore;
	}
	public double getEnglishScore() {
		return englishScore;
	}
	public void setEnglishScore(double englishScore) {
		this.englishScore = englishScore;
	}
	public String getRole() {
		return role;
	}
	public void setRole(String role) {
		this.role = role;
	}
	
	public User(String cardNum, String pass, String name, String province, double chineseScore, double mathScore,
			double englishScore, String role) {
		this.cardNum = cardNum;
		this.pass = pass;
		this.name = name;
		this.province = province;
		this.chineseScore = chineseScore;
		this.mathScore = mathScore;
		this.englishScore = englishScore;
		this.role = role;
	}
	public User() {
	}
	
	
	
	public User(String cardNum, String pass, String name, int age, String province, String city, String address,
			double chineseScore, double mathScore, double englishScore, String role) {
		super();
		this.cardNum = cardNum;
		this.pass = pass;
		this.name = name;
		this.age = age;
		this.province = province;
		this.city = city;
		this.address = address;
		this.chineseScore = chineseScore;
		this.mathScore = mathScore;
		this.englishScore = englishScore;
		this.role = role;
	}
	public User(String name, String province, double chineseScore, double mathScore, double englishScore, String role) {
		super();
		this.name = name;
		this.province = province;
		this.chineseScore = chineseScore;
		this.mathScore = mathScore;
		this.englishScore = englishScore;
		this.role = role;
	}
	
	
	
	@Override
	public String toString() {
		return "User [cardNum=" + cardNum + ", pass=" + pass + ", name=" + name + ", age=" + age + ", province="
				+ province + ", city=" + city + ", address=" + address + ", chineseScore=" + chineseScore
				+ ", mathScore=" + mathScore + ", englishScore=" + englishScore + ", role=" + role + ", total=" + total
				+ "]";
	}
	/**
	 * Collections排序
	 */
	@Override
	public int compareTo(User o) {
		// TODO Auto-generated method stub
		return (int) (this.getTotal()-o.getTotal());
	}
	
	
	
	
	
	
	
	
	
	
	
	

}
